﻿namespace HRM.CORE
{
    using DevExpress.Utils;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Grid;
    using Common.Class; using APP.HELPER.Utils.Language; using Security.Security; using Dictionary.ERP;
    using Dictionary;
    using HRM.CORE;
    using HRM.CORE.Properties;
    
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms; using Common;

    public class xfmTransfer : XtraForm
    {
        private SimpleButton btCancel;
        private SimpleButton btOK;
        private CheckEdit cheIsChangeMinimumSalary;
        private IContainer components;
        private DataTable dt_Employee;
        private GridLookUpEdit glkBranch;
        private GridLookUpEdit glkDepartment;
        private GridLookUpEdit glkGroup;
        private GroupControl grEmployeeList;
        private GroupControl grGoto;
        private GridColumn gridColumn10;
        private GridColumn gridColumn5;
        private GridColumn gridColumn6;
        private GridColumn gridColumn7;
        private GridColumn gridColumn8;
        private GridColumn gridColumn9;
        private GridView gridLookUpEdit1View;
        private GridView gridView4;
        private GridView gridView5;
        private DevExpress.Utils.ImageCollection imgList;
        private ImageListBoxControl imglistEmployee;
        private LabelControl lcBranch;
        private LabelControl lcDepartment;
        private LabelControl lcGroup;
        private PanelControl panelControl1;
        private SplitContainerControl splitContainerControl1;

        public event SuccessEventHander Success;

        public xfmTransfer()
        {
            this.dt_Employee = new DataTable();
            this.components = null;
            this.InitializeComponent();
            this.InitMultiLanguages();
        }

        public xfmTransfer(DataTable Employee)
        {
            this.dt_Employee = new DataTable();
            this.components = null;
            this.InitializeComponent();
            this.InitMultiLanguages();
            this.InitData();
            this.dt_Employee = Employee;
            foreach (DataRow row in this.dt_Employee.Rows)
            {
                try
                {
                    ImageListBoxItem item = new ImageListBoxItem {
                        Value = row["FirstName"].ToString() + " " + row["LastName"].ToString() + " (" + row["EmployeeCode"].ToString() + ")"
                    };
                    if (bool.Parse(row["Sex"].ToString()))
                    {
                        item.ImageIndex = 0;
                    }
                    else
                    {
                        item.ImageIndex = 1;
                    }
                    if (int.Parse(row["Status"].ToString()) == 3)
                    {
                        item.Value = item.Value.ToString() + " - Đ\x00e3 nghỉ việc";
                        item.ImageIndex = 2;
                    }
                    this.imglistEmployee.Items.Add(item);
                }
                catch
                {
                }
            }
        }

        private void AddComboboxEdit(ComboBoxEdit combo, string str)
        {
            combo.Properties.Items.Add(str);
            combo.SelectedIndex = combo.Properties.Items.Count - 1;
        }

        private void btCancel_Click(object sender, EventArgs e)
        {
            base.Close();
        }

        private void btOK_Click(object sender, EventArgs e)
        {
            if (this.glkBranch.EditValue == null)
            {
                XtraMessageBox.Show("H\x00e3y chọn chi nh\x00e1nh l\x00e0m việc cho c\x00e1c ứng vi\x00ean được tuyển dụng!");
            }
            else
            {
                HRM_BRANCH hrm_branch = new HRM_BRANCH();
                hrm_branch.Get(this.glkBranch.EditValue.ToString());
                foreach (ImageListBoxItem item in this.imglistEmployee.Items)
                {
                    try
                    {
                        string str = item.Value.ToString();
                        char[] separator = new char[] { '(', ')' };
                        string employeeCode = str.Split(separator)[1];
                        HRM_EMPLOYEE hrm_employee = new HRM_EMPLOYEE();
                        hrm_employee.Get(employeeCode);
                        if (hrm_employee.Status != 3)
                        {
                            hrm_employee.BranchCode = this.glkBranch.EditValue.ToString();
                            if ((this.glkDepartment.EditValue == null) || (this.glkDepartment.Text == ""))
                            {
                                hrm_employee.DepartmentCode = DBNull.Value.ToString();
                            }
                            else
                            {
                                hrm_employee.DepartmentCode = this.glkDepartment.EditValue.ToString();
                            }
                            if ((this.glkGroup.EditValue == null) || (this.glkGroup.Text == ""))
                            {
                                hrm_employee.GroupCode = DBNull.Value.ToString();
                            }
                            else
                            {
                                hrm_employee.GroupCode = this.glkGroup.EditValue.ToString();
                            }
                            if (this.cheIsChangeMinimumSalary.Checked)
                            {
                                hrm_employee.MinimumSalary = hrm_branch.MinimumSalary;
                                if (hrm_employee.PayForm == 0)
                                {
                                    hrm_employee.BasicSalary = decimal.Parse(hrm_employee.CoefficientSalary.ToString()) * hrm_employee.MinimumSalary;
                                }
                            }
                            hrm_employee.Update();
                        }
                    }
                    catch
                    {
                    }
                }
                base.Close();
                XtraMessageBox.Show("Qu\x00e1 tr\x00ecnh ho\x00e0n tất!");
                this.RaiseSuccessEventHander();
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void glk_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            xfmBranchAdd.AddedEventHander hander = null;
            xfmDepartmentAdd.AddedEventHander hander2 = null;
            Dictionary.xfmGroupAdd.AddedEventHander hander3 = null;
            if (e.Button.Kind == ButtonPredefines.Glyph)
            {
                GridLookUpEdit edit = sender as GridLookUpEdit;
                string name = edit.Name;
                if (name != null)
                {
                    if (!(name == "glkBranch"))
                    {
                        if (name == "glkDepartment")
                        {
                            xfmDepartmentAdd add2 = new xfmDepartmentAdd(Actions.Add);
                            if (hander2 == null)
                            {
                                hander2 = (s, i) => new HRM_DEPARTMENT().AddGridLookupEdit(this.glkDepartment, this.glkBranch.EditValue.ToString());
                            }
                            add2.Added += hander2;
                            add2.ShowDialog();
                        }
                        else if (name == "glkGroup")
                        {
                            Dictionary.xfmGroupAdd add3 = new Dictionary.xfmGroupAdd(Actions.Add);
                            if (hander3 == null)
                            {
                                hander3 = (s, i) => new HRM_GROUP().AddGridLookupEdit(this.glkGroup, this.glkDepartment.EditValue.ToString());
                            }
                            add3.Added += hander3;
                            add3.ShowDialog();
                        }
                    }
                    else
                    {
                        xfmBranchAdd add = new xfmBranchAdd(Actions.Add);
                        if (hander == null)
                        {
                            hander = (s, i) => new HRM_BRANCH().AddGridLookupEdit(this.glkBranch);
                        }
                        add.Added += hander;
                        add.ShowDialog();
                    }
                }
            }
        }

        private void glkBranch_EditValueChanged(object sender, EventArgs e)
        {
            new HRM_DEPARTMENT().AddGridLookupEdit(this.glkDepartment, this.glkBranch.EditValue.ToString());
        }

        private void glkDepartment_EditValueChanged(object sender, EventArgs e)
        {
            new HRM_GROUP().AddGridLookupEdit(this.glkGroup, this.glkDepartment.EditValue.ToString());
            if (this.glkGroup.Text == "")
            {
                this.glkGroup.EditValue = null;
            }
        }

        private void imglistEmployee_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Delete)
            {
                this.imglistEmployee.Items.RemoveAt(this.imglistEmployee.SelectedIndex);
            }
        }

        private void InitData()
        {
            new HRM_BRANCH().AddGridLookupEdit(this.glkBranch);
        }

        private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(xfmTransfer));
            SerializableAppearanceObject appearance = new SerializableAppearanceObject();
            SerializableAppearanceObject obj3 = new SerializableAppearanceObject();
            SerializableAppearanceObject obj4 = new SerializableAppearanceObject();
            this.grGoto = new GroupControl();
            this.lcGroup = new LabelControl();
            this.lcDepartment = new LabelControl();
            this.lcBranch = new LabelControl();
            this.glkBranch = new GridLookUpEdit();
            this.gridLookUpEdit1View = new GridView();
            this.gridColumn5 = new GridColumn();
            this.gridColumn6 = new GridColumn();
            this.glkDepartment = new GridLookUpEdit();
            this.gridView4 = new GridView();
            this.gridColumn7 = new GridColumn();
            this.gridColumn8 = new GridColumn();
            this.glkGroup = new GridLookUpEdit();
            this.gridView5 = new GridView();
            this.gridColumn9 = new GridColumn();
            this.gridColumn10 = new GridColumn();
            this.splitContainerControl1 = new SplitContainerControl();
            this.grEmployeeList = new GroupControl();
            this.imglistEmployee = new ImageListBoxControl();
            this.imgList = new DevExpress.Utils.ImageCollection(this.components);
            this.panelControl1 = new PanelControl();
            this.btCancel = new SimpleButton();
            this.btOK = new SimpleButton();
            this.cheIsChangeMinimumSalary = new CheckEdit();
            this.grGoto.BeginInit();
            this.grGoto.SuspendLayout();
            this.glkBranch.Properties.BeginInit();
            this.gridLookUpEdit1View.BeginInit();
            this.glkDepartment.Properties.BeginInit();
            this.gridView4.BeginInit();
            this.glkGroup.Properties.BeginInit();
            this.gridView5.BeginInit();
            this.splitContainerControl1.BeginInit();
            this.splitContainerControl1.SuspendLayout();
            this.grEmployeeList.BeginInit();
            this.grEmployeeList.SuspendLayout();
            ((ISupportInitialize) this.imglistEmployee).BeginInit();
            this.imgList.BeginInit();
            this.panelControl1.BeginInit();
            this.panelControl1.SuspendLayout();
            this.cheIsChangeMinimumSalary.Properties.BeginInit();
            base.SuspendLayout();
            this.grGoto.Controls.Add(this.cheIsChangeMinimumSalary);
            this.grGoto.Controls.Add(this.lcGroup);
            this.grGoto.Controls.Add(this.lcDepartment);
            this.grGoto.Controls.Add(this.lcBranch);
            this.grGoto.Controls.Add(this.glkBranch);
            this.grGoto.Controls.Add(this.glkDepartment);
            this.grGoto.Controls.Add(this.glkGroup);
            this.grGoto.Dock = DockStyle.Fill;
            this.grGoto.Location = new Point(0, 0);
            this.grGoto.Name = "grGoto";
            this.grGoto.Size = new Size(0x17a, 0x184);
            this.grGoto.TabIndex = 2;
            this.grGoto.Text = "Chuyển đến";
            this.lcGroup.Location = new Point(11, 0x60);
            this.lcGroup.Name = "lcGroup";
            this.lcGroup.Size = new Size(0x2d, 13);
            this.lcGroup.TabIndex = 0x12;
            this.lcGroup.Text = "Tổ nh\x00f3m:";
            this.lcDepartment.AllowHtmlString = true;
            this.lcDepartment.Location = new Point(11, 0x44);
            this.lcDepartment.Name = "lcDepartment";
            this.lcDepartment.Size = new Size(0x37, 14);
            this.lcDepartment.TabIndex = 0x11;
            this.lcDepartment.Text = "Ph\x00f2ng ban:";
            this.lcBranch.AllowHtmlString = true;
            this.lcBranch.Location = new Point(11, 40);
            this.lcBranch.Name = "lcBranch";
            this.lcBranch.Size = new Size(0x45, 14);
            this.lcBranch.TabIndex = 0x10;
            this.lcBranch.Text = "Chi nh\x00e1nh <color=red>(*)</color>:";
            this.glkBranch.Location = new Point(0x66, 0x24);
            this.glkBranch.Name = "glkBranch";
            this.glkBranch.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo), new EditorButton(ButtonPredefines.Glyph, "Th\x00eam", -1, true, true, false, ImageLocation.MiddleCenter, (Image) manager.GetObject("glkBranch.Properties.Buttons"), new KeyShortcut(Keys.None), appearance, "", null, null, true) });
            this.glkBranch.Properties.NullText = "[Chọn chi nh\x00e1nh]";
            this.glkBranch.Properties.View = this.gridLookUpEdit1View;
            this.glkBranch.Size = new Size(0x107, 0x16);
            this.glkBranch.TabIndex = 13;
            this.glkBranch.ButtonClick += new ButtonPressedEventHandler(this.glk_ButtonClick);
            this.glkBranch.EditValueChanged += new EventHandler(this.glkBranch_EditValueChanged);
            this.gridLookUpEdit1View.Columns.AddRange(new GridColumn[] { this.gridColumn5, this.gridColumn6 });
            this.gridLookUpEdit1View.FocusRectStyle = DrawFocusRectStyle.RowFocus;
            this.gridLookUpEdit1View.Name = "gridLookUpEdit1View";
            this.gridLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.gridLookUpEdit1View.OptionsView.ShowGroupPanel = false;
            this.gridColumn5.Caption = "M\x00e3 chi nh\x00e1nh";
            this.gridColumn5.FieldName = "BranchCode";
            this.gridColumn5.Name = "gridColumn5";
            this.gridColumn5.Visible = true;
            this.gridColumn5.VisibleIndex = 0;
            this.gridColumn6.Caption = "T\x00ean chi nh\x00e1nh";
            this.gridColumn6.FieldName = "BranchName";
            this.gridColumn6.Name = "gridColumn6";
            this.gridColumn6.Visible = true;
            this.gridColumn6.VisibleIndex = 1;
            this.glkDepartment.Location = new Point(0x66, 0x40);
            this.glkDepartment.Name = "glkDepartment";
            this.glkDepartment.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo), new EditorButton(ButtonPredefines.Glyph, "Th\x00eam", -1, true, true, false, ImageLocation.MiddleCenter, (Image) manager.GetObject("glkDepartment.Properties.Buttons"), new KeyShortcut(Keys.None), obj3, "", null, null, true) });
            this.glkDepartment.Properties.NullText = "[Chọn ph\x00f2ng ban thuộc chi nh\x00e1nh]";
            this.glkDepartment.Properties.View = this.gridView4;
            this.glkDepartment.Size = new Size(0x107, 0x16);
            this.glkDepartment.TabIndex = 12;
            this.glkDepartment.ButtonClick += new ButtonPressedEventHandler(this.glk_ButtonClick);
            this.glkDepartment.EditValueChanged += new EventHandler(this.glkDepartment_EditValueChanged);
            this.gridView4.Columns.AddRange(new GridColumn[] { this.gridColumn7, this.gridColumn8 });
            this.gridView4.FocusRectStyle = DrawFocusRectStyle.RowFocus;
            this.gridView4.Name = "gridView4";
            this.gridView4.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.gridView4.OptionsView.ShowGroupPanel = false;
            this.gridColumn7.Caption = "M\x00e3 ph\x00f2ng ban";
            this.gridColumn7.FieldName = "DepartmentCode";
            this.gridColumn7.Name = "gridColumn7";
            this.gridColumn7.Visible = true;
            this.gridColumn7.VisibleIndex = 0;
            this.gridColumn8.Caption = "T\x00ean ph\x00f2ng ban";
            this.gridColumn8.FieldName = "DepartmentName";
            this.gridColumn8.Name = "gridColumn8";
            this.gridColumn8.Visible = true;
            this.gridColumn8.VisibleIndex = 1;
            this.glkGroup.Location = new Point(0x66, 0x5c);
            this.glkGroup.Name = "glkGroup";
            this.glkGroup.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo), new EditorButton(ButtonPredefines.Glyph, "Th\x00eam", -1, true, true, false, ImageLocation.MiddleCenter, (Image) manager.GetObject("glkGroup.Properties.Buttons"), new KeyShortcut(Keys.None), obj4, "", null, null, true) });
            this.glkGroup.Properties.NullText = "[Chọn tổ nh\x00f3m thuộc ph\x00f2ng ban]";
            this.glkGroup.Properties.View = this.gridView5;
            this.glkGroup.Size = new Size(0x107, 0x16);
            this.glkGroup.TabIndex = 14;
            this.glkGroup.ButtonClick += new ButtonPressedEventHandler(this.glk_ButtonClick);
            this.gridView5.Columns.AddRange(new GridColumn[] { this.gridColumn9, this.gridColumn10 });
            this.gridView5.FocusRectStyle = DrawFocusRectStyle.RowFocus;
            this.gridView5.Name = "gridView5";
            this.gridView5.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.gridView5.OptionsView.ShowGroupPanel = false;
            this.gridColumn9.Caption = "M\x00e3 tổ nh\x00f3m";
            this.gridColumn9.FieldName = "GroupCode";
            this.gridColumn9.Name = "gridColumn9";
            this.gridColumn9.Visible = true;
            this.gridColumn9.VisibleIndex = 0;
            this.gridColumn10.Caption = "T\x00ean tổ nh\x00f3m";
            this.gridColumn10.FieldName = "GroupName";
            this.gridColumn10.Name = "gridColumn10";
            this.gridColumn10.Visible = true;
            this.gridColumn10.VisibleIndex = 1;
            this.splitContainerControl1.Dock = DockStyle.Fill;
            this.splitContainerControl1.Location = new Point(0, 0);
            this.splitContainerControl1.Name = "splitContainerControl1";
            this.splitContainerControl1.Panel1.Controls.Add(this.grEmployeeList);
            this.splitContainerControl1.Panel1.Text = "Panel1";
            this.splitContainerControl1.Panel2.Controls.Add(this.grGoto);
            this.splitContainerControl1.Panel2.Text = "Panel2";
            this.splitContainerControl1.Size = new Size(0x26f, 0x184);
            this.splitContainerControl1.SplitterPosition = 0xef;
            this.splitContainerControl1.TabIndex = 7;
            this.splitContainerControl1.Text = "splitContainerControl1";
            this.grEmployeeList.Controls.Add(this.imglistEmployee);
            this.grEmployeeList.Dock = DockStyle.Fill;
            this.grEmployeeList.Location = new Point(0, 0);
            this.grEmployeeList.Name = "grEmployeeList";
            this.grEmployeeList.Size = new Size(0xef, 0x184);
            this.grEmployeeList.TabIndex = 1;
            this.grEmployeeList.Text = "Danh s\x00e1ch nh\x00e2n vi\x00ean";
            this.imglistEmployee.BorderStyle = BorderStyles.NoBorder;
            this.imglistEmployee.Dock = DockStyle.Fill;
            this.imglistEmployee.HorizontalScrollbar = true;
            this.imglistEmployee.ImageList = this.imgList;
            this.imglistEmployee.Location = new Point(2, 0x16);
            this.imglistEmployee.Name = "imglistEmployee";
            this.imglistEmployee.Size = new Size(0xeb, 0x16c);
            this.imglistEmployee.TabIndex = 0;
            this.imglistEmployee.KeyDown += new KeyEventHandler(this.imglistEmployee_KeyDown);
            this.imgList.ImageStream = (ImageCollectionStreamer) manager.GetObject("imgList.ImageStream");
            this.imgList.Images.SetKeyName(0, "male.png");
            this.imgList.Images.SetKeyName(1, "user_woman.png");
            this.imgList.Images.SetKeyName(2, "Action_Delete.png");
            this.panelControl1.BorderStyle = BorderStyles.NoBorder;
            this.panelControl1.Controls.Add(this.btCancel);
            this.panelControl1.Controls.Add(this.btOK);
            this.panelControl1.Dock = DockStyle.Bottom;
            this.panelControl1.Location = new Point(0, 0x184);
            this.panelControl1.Name = "panelControl1";
            this.panelControl1.Size = new Size(0x26f, 0x30);
            this.panelControl1.TabIndex = 8;
            this.btCancel.Image = Resources.Exit;
            this.btCancel.Location = new Point(0x174, 13);
            this.btCancel.Name = "btCancel";
            this.btCancel.Size = new Size(0x6f, 0x17);
            this.btCancel.TabIndex = 1;
            this.btCancel.Text = "Tho\x00e1t (x)";
            this.btCancel.Click += new EventHandler(this.btCancel_Click);
            this.btOK.Image = MsgResc.edit;
            this.btOK.ImageList = this.imgList;
            this.btOK.Location = new Point(0x1ef, 13);
            this.btOK.Name = "btOK";
            this.btOK.Size = new Size(0x6f, 0x17);
            this.btOK.TabIndex = 0;
            this.btOK.Text = "Đồng \x00dd >>";
            this.btOK.Click += new EventHandler(this.btOK_Click);
            this.cheIsChangeMinimumSalary.EditValue = true;
            this.cheIsChangeMinimumSalary.Location = new Point(9, 0x86);
            this.cheIsChangeMinimumSalary.Name = "cheIsChangeMinimumSalary";
            this.cheIsChangeMinimumSalary.Properties.Caption = "Thay đổi lương tối thiểu theo chi nh\x00e1nh được chọn";
            this.cheIsChangeMinimumSalary.Size = new Size(0x10a, 0x13);
            this.cheIsChangeMinimumSalary.TabIndex = 0x13;
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x26f, 0x1b4);
            base.Controls.Add(this.splitContainerControl1);
            base.Controls.Add(this.panelControl1);
            base.FormBorderStyle = FormBorderStyle.FixedSingle;
            base.MaximizeBox = false;
            base.MinimizeBox = false;
            base.Name = "xfmTransfer";
            base.ShowIcon = false;
            base.ShowInTaskbar = false;
            base.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "Chuyển Ph\x00f2ng Ban";
            this.grGoto.EndInit();
            this.grGoto.ResumeLayout(false);
            this.grGoto.PerformLayout();
            this.glkBranch.Properties.EndInit();
            this.gridLookUpEdit1View.EndInit();
            this.glkDepartment.Properties.EndInit();
            this.gridView4.EndInit();
            this.glkGroup.Properties.EndInit();
            this.gridView5.EndInit();
            this.splitContainerControl1.EndInit();
            this.splitContainerControl1.ResumeLayout(false);
            this.grEmployeeList.EndInit();
            this.grEmployeeList.ResumeLayout(false);
            ((ISupportInitialize) this.imglistEmployee).EndInit();
            this.imgList.EndInit();
            this.panelControl1.EndInit();
            this.panelControl1.ResumeLayout(false);
            this.cheIsChangeMinimumSalary.Properties.EndInit();
            base.ResumeLayout(false);
        }

        private void InitMultiLanguages()
        {
            this.Text = MultiLanguages.GetString("tbl_EmployeeTransfer", "Recruitment", this.Text);
            this.grEmployeeList.Text = MultiLanguages.GetString("tbl_EmployeeTransfer", "grEmployeeList", this.grEmployeeList.Text);
            this.grGoto.Text = MultiLanguages.GetString("tbl_EmployeeTransfer", "grGoto", this.grGoto.Text);
            this.lcBranch.Text = MultiLanguages.GetString("tbl_EmployeeTransfer", "BranchName", this.lcBranch.Text);
            this.lcDepartment.Text = MultiLanguages.GetString("tbl_EmployeeTransfer", "DepartmentName", this.lcDepartment.Text);
            this.lcGroup.Text = MultiLanguages.GetString("tbl_EmployeeTransfer", "GroupName", this.lcGroup.Text);
            this.btCancel.Text = MultiLanguages.GetString("tbl_EmployeeTransfer", "Cancel", this.btCancel.Text);
            this.btOK.Text = MultiLanguages.GetString("tbl_EmployeeTransfer", "OK", this.btOK.Text);
        }

        private void RaiseSuccessEventHander()
        {
            if (this.Success != null)
            {
                this.Success(this);
            }
        }

        public delegate void SuccessEventHander(object sender);
    }
}

